#include <func.h>


int main()
{
    sigset_t mask;
    sigemptyset(&mask);
    sigaddset(&mask,SIGINT);
    int ret=sigprocmask(SIG_BLOCK,&mask,NULL);//NULL存放信号原有信号集
    ERROR_CHECK(ret,-1,"sigprocmask");
    printf("SIGINT is block\n");
    sleep(5);
    sigset_t pend;
    sigemptyset(&pend);
    ret=sigpending(&pend);
    ERROR_CHECK(ret,-1,"sigpending");
    if(sigismember(&pend,SIGINT))
    {
        printf("sigint is pending\n");
    }
    else
    {
        printf("sigint is not pending\n");
    }
    printf("SIGINT is not block\n");
    ret=sigprocmask(SIG_UNBLOCK,&mask,NULL);
    ERROR_CHECK(ret,-1,"sigprocmask");
    return 0;
}